Skip to content

Conversation

@thekaveman
Copy link
Member

@thekaveman thekaveman commented Oct 8, 2025

Closes #2780

What this PR does

  • Creates a new model EligibilityApiConfig for agency-specific Eligibility API data (public/private client keys)
  • Data migration for existing TransitAgency with Eligibility API config
  • Removes config fields from TransitAgency, adds optional foreign key to EligibilityApiConfig
  • Creates a new model EligibilityApiVerificationRequest for flow-specific Eligibility API data (keys, JWT config)
  • Data migration for existing EnrollmentFlow with Eligibility API config
  • Remove config fields from EnrollmentFlow, adds optional foreign key to EligibilityApiVerificationRequest

The idea is to make configuration of flows simpler going forward, as we don't expect to use this API for new flows, simply maintaining the existing 2 in production (MST Courtesy Cards, SBMTD Reduced Fare Mobility ID).

The EligibilityApiConfig changes weren't necessarily spelled out in #2780. However they are similar enough, and similarly meant to make the TransitAgency configuration experience simpler for agencies going forward.

Testing the PR

User flow

  1. Checkout the branch
  2. Reset your database with local_fixtures.json from the branch
  3. Launch the app with F5
  4. Run through CST Agency Card eligibility
  5. Expect to pass, see no errors

Admin (superuser)

  1. Login to the admin as a superuser
  2. Confirm you can see and change both new model classes and the corresponding foreign key fields

Admin (Cal-ITP user)

  1. Login to the admin as calitp-user
  2. Confirm you cannot see the model admins for either new class
  3. Confirm you can see and change the corresponding foreign key fields

@thekaveman thekaveman self-assigned this Oct 8, 2025
@github-actions github-actions bot added tests Related to automated testing (unit, UI, integration, etc.) migrations [auto] Review for potential model changes/needed data migrations updates back-end Django views, sessions, middleware, models, migrations etc. labels Oct 8, 2025
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/core
  views.py
  benefits/core/admin
  enrollment.py 46
  transit.py
  benefits/core/models
  __init__.py
  enrollment.py 66, 176, 184, 220
  transit.py 93, 195, 202
  benefits/eligibility
  verify.py
  benefits/oauth
  middleware.py
Project Total  

This report was generated by python-coverage-comment-action

@thekaveman thekaveman force-pushed the refactor/eligibility-api-config branch 2 times, most recently from 2973c95 to 8d04366 Compare October 8, 2025 22:45
@thekaveman thekaveman marked this pull request as ready for review October 8, 2025 22:51
@thekaveman thekaveman requested a review from a team as a code owner October 8, 2025 22:51
@thekaveman thekaveman requested a review from Scotchester October 8, 2025 22:52
@Scotchester
Copy link
Member

Scotchester commented Oct 9, 2025

When I try to go through the CST Agency Card flow, I'm getting this after submitting my card details in the Littlepay window:

> Group db631fbb-7949-485a-8068-066dd826acac not found

Seems unrelated to your changes, because that group ID is in an existing fixture that wasn't modified. Confirmed all my other Littlepay config seems to be set correctly. Any idea what's going on?

Update: This is also happening (with a different group ID) for the Older Adults flow.

Resolved. Forgot that the group IDs needed to be updated in my local config.

@thekaveman
Copy link
Member Author

Also note that this PR doesn't have anything to do with Enrollment, so I wouldn't expect that to necessarily be a part of the review process. Glad you got it sorted though!

Copy link
Member

@Scotchester Scotchester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems to be working well! I left a few non-blocking questions and comments inline.

P.S.: I did also run the migration against a DB initiated on main and the data was migrated as expected.

@thekaveman thekaveman force-pushed the refactor/eligibility-api-config branch from 8d04366 to 38d75d3 Compare October 21, 2025 20:59
@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back-end Django views, sessions, middleware, models, migrations etc. migrations [auto] Review for potential model changes/needed data migrations updates tests Related to automated testing (unit, UI, integration, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: separate Eligiblity API config from EnrollmentFlow

3 participants